package cn.syncrond.tcm.service.log;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @Description: 简单的日志服务实现类
 * @author meepai
 * @date 2016-11-21
 */
public class SimpleLogService implements ILogService {

	private static final Log log = LogFactory.getLog(SimpleLogService.class);
	
	@Override
	public void log(LogLevel level, String message) {
		switch(level){
		case DEBUG:
			if(log.isDebugEnabled()){
				log.debug(message);
			}
			break;
		case INFO:
			if(log.isInfoEnabled()){
				log.info(message);
			}
			break;
		case WARN:
			if(log.isWarnEnabled()){
				log.warn(message);
			}
			break;
		case ERROR:
			if(log.isErrorEnabled()){
				log.error(message);
			}
			break;
		}
	}
}
